home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Applications / Lotto / lottowhiz.cp.txt < prev    next >
Encoding:
Text File  |  1997-02-01  |  48.2 KB  |  2,347 lines  |  [TEXT/CWIE]

  1. /*
  2.     Well, this is a quick hack.
  3.     The code is very sloppy, but it does what it should do
  4.     The theory here is to pick mostly numbers that have come up one time
  5.     in the last ten times.  The rest of the numbers are randomized.
  6.     
  7.     Earl Schellhous
  8. */
  9.  
  10. #include <iostream.h>
  11. #include <iomanip.h>
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <time.h>
  15.  
  16. #include "lottowhiz.h"
  17. int seed = 0;
  18. time_t *curtime = 0;
  19.  
  20.  
  21.  
  22. void main(void)
  23. {
  24.     // our all-purpose indexes
  25.     int index, index1, index2;
  26.     int count = 0;
  27.     int count2 = 0;
  28.     int count3 = 0;
  29.     int setnum = 0;
  30.     int pickwin = 0;
  31.     char instring[100] = {0x00};
  32.     char tempstring[10] = {0x00};
  33.     
  34.     
  35.     
  36.     cout << "Enter the last 10 Lotto Draws." << endl;
  37.     cout << "IMPORTANT!: start with the last draw first!!" << endl;
  38.     cout << "Use the form number <dot> number <dot>." << endl;
  39.     cout << "The entry of numbers is easy using the keypad and enter key!" << endl;
  40.     cout << "Example: 11.14.15.28.29.47  ( no period on the end )." << endl;
  41.     cout << "There is limited editing and saving" << endl << endl;
  42.     cout << "This program will generate 5 numbers to use in the next draw!" << endl;
  43.     cout << "You can use your printer to print out the stats and results!" << endl;
  44.     cout << "If you don't like the sets of numbers, try it again!!" << endl;
  45.     cout << endl << endl << endl;
  46.     
  47.     // this sets up the array of pointers to structs
  48.     for( index = 0; index < 10; index++ )
  49.     {
  50.         array[index] =  new struct lottonum;
  51.         array[index]->odds = 0;
  52.         array[index]->evens = 0;
  53.         array[index]->reds = 0;
  54.         array[index]->whites = 0;
  55.         array[index]->blues = 0;
  56.         array[index]->average = 0;
  57.         array[index]->sum_of_diffs = 0;
  58.         
  59.         
  60.             switch( index )
  61.             {
  62.                 case 0:
  63.                     {
  64.                         array[index]->next = array[index + 1];
  65.                         array[index]->prev = 0;
  66.                     } break;
  67.                     
  68.                 case 9:
  69.                     {
  70.                         array[index]->prev = array[index - 1];
  71.                         array[index]->next = 0;
  72.                     } break;
  73.                     
  74.                 default:
  75.                     {
  76.                         array[index]->next = array[index + 1];
  77.                         array[index]->prev = array[index - 1];
  78.                     } break;
  79.                 
  80.             }
  81.     }
  82.         
  83.     for(count3 = 0; count3 < 10; count3++ )
  84.     {
  85.         cin >> instring;
  86.         count = 0;
  87.         count2 = 0;
  88.         setnum = 0;
  89.         int increment = 0;
  90.         
  91.             do {
  92.                     increment = 0;
  93.                     while( (instring[count] != '.') && (instring[count] != 0) )
  94.                     {
  95.                         tempstring[increment] = instring[count];
  96.                         increment++;
  97.                         count++;    
  98.                     }
  99.                 
  100.                 array[count3]->set[setnum] = atoi( tempstring );
  101.                 
  102.                     if( setnum < 7 )
  103.                     {
  104.                         while( count2 < 10 )
  105.                         {
  106.                             tempstring[count2] = 0x00;
  107.                             count2++;
  108.                         }
  109.                         count++;
  110.                         count2 = 0;    
  111.                     }
  112.                     setnum++;
  113.                     
  114.             } while( instring[count] != '0x00' && setnum < 6 );
  115.             
  116.         int hold1 = 0;  // simple bubble sort here
  117.         
  118.         
  119.         for( int pass1 = 0; pass1 < 10; pass1++ )
  120.         {
  121.             for( int pass2 = 0; pass2 < 6; pass2++ )
  122.             {
  123.                 for( int d = 0; d < (6 - 1); d++ )
  124.                 {
  125.                     if( array[pass1]->set[d] > array[pass1]->set[d+1] )
  126.                     {
  127.                         hold1 = array[pass1]->set[d];
  128.                         array[pass1]->set[d] = array[pass1]->set[d + 1];
  129.                         array[pass1]->set[d + 1] = hold1;
  130.                     }
  131.                 }
  132.             }
  133.         }
  134.                         
  135.                  
  136.         cout << "Set Number " << count3 + 1 << " is: " 
  137.         << array[count3]->set[0] << ' '
  138.         << array[count3]->set[1] << ' '
  139.         << array[count3]->set[2] << ' '
  140.         << array[count3]->set[3] << ' '
  141.         << array[count3]->set[4] << ' '
  142.         << array[count3]->set[5] << ' '
  143.         << endl;
  144.     }
  145.                     
  146.             
  147.     // this counts the occurrances of numbers in the sets
  148.     // count_array[]:
  149.     // 0 is ommitted to make count_array easier to understand
  150.     // 52 is ommitted to make room for the NULL terminator in count_array
  151.     for( index1 = 0; index1 < 10; index1++ )
  152.     {
  153.         for( index2 = 0; index2 < 6; index2++ )
  154.         {
  155.             switch( array[index1]->set[index2] )
  156.             {
  157.                 case 1: 
  158.                     {
  159.                         count_array[1]++;
  160.                         array[index1]->odds++;
  161.                         array[index1]->reds++;
  162.                     } continue;
  163.                     
  164.                 case 2:
  165.                     {
  166.                         count_array[2]++;
  167.                         array[index1]->evens++;
  168.                         array[index1]->reds++;
  169.                     } continue;
  170.                     
  171.                 case 3: 
  172.                     {
  173.                         count_array[3]++;
  174.                         array[index1]->odds++;
  175.                         array[index1]->reds++;
  176.                     } continue;
  177.                     
  178.                 case 4: 
  179.                     {
  180.                         count_array[4]++;
  181.                         array[index1]->evens++;
  182.                         array[index1]->reds++;
  183.                     } continue;
  184.                     
  185.                 case 5: 
  186.                     {
  187.                         count_array[5]++;
  188.                         array[index1]->odds++;
  189.                         array[index1]->reds++;
  190.                     } continue;
  191.                     
  192.                 case 6: 
  193.                     {
  194.                         count_array[6]++;
  195.                         array[index1]->evens++;
  196.                         array[index1]->reds++;
  197.                     } continue;
  198.                     
  199.                 case 7: 
  200.                     {
  201.                         count_array[7]++;
  202.                         array[index1]->odds++;
  203.                         array[index1]->reds++;
  204.                     } continue;
  205.                     
  206.                 case 8: 
  207.                     {
  208.                         count_array[8]++;
  209.                         array[index1]->evens++;
  210.                         array[index1]->reds++;
  211.                     } continue;
  212.                     
  213.                 case 9: 
  214.                     {
  215.                         count_array[9]++;
  216.                         array[index1]->odds++;
  217.                         array[index1]->reds++;
  218.                     } continue;
  219.                     
  220.                 case 10: 
  221.                     {
  222.                         count_array[10]++;
  223.                         array[index1]->evens++;
  224.                         array[index1]->reds++;
  225.                     } continue;
  226.                     
  227.                 case 11: 
  228.                     {
  229.                         count_array[11]++;
  230.                         array[index1]->odds++;
  231.                         array[index1]->reds++;
  232.                     } continue;
  233.                     
  234.                 case 12: 
  235.                     {
  236.                         count_array[12]++;
  237.                         array[index1]->evens++;
  238.                         array[index1]->reds++;
  239.                     } continue;
  240.                     
  241.                 case 13: 
  242.                     {
  243.                         count_array[13]++;
  244.                         array[index1]->odds++;
  245.                         array[index1]->reds++;
  246.                     } continue;
  247.                     
  248.                 case 14: 
  249.                     {
  250.                         count_array[14]++;
  251.                         array[index1]->evens++;
  252.                         array[index1]->reds++;
  253.                     } continue;
  254.                     
  255.                 case 15: 
  256.                     {
  257.                         count_array[15]++;
  258.                         array[index1]->odds++;
  259.                         array[index1]->reds++;
  260.                     } continue;
  261.                 
  262.                 case 16:
  263.                     {
  264.                         count_array[16]++;
  265.                         array[index1]->evens++;
  266.                         array[index1]->reds++;
  267.                     } continue;
  268.                     
  269.                 case 17:
  270.                     {
  271.                         count_array[17]++;
  272.                         array[index1]->odds++;
  273.                         array[index1]->reds++;
  274.                     } continue;
  275.                                                 // end of reds
  276.                 case 18:
  277.                     {
  278.                         count_array[18]++;
  279.                         array[index1]->evens++;
  280.                         array[index1]->whites++;
  281.                     } continue;
  282.                     
  283.                 case 19:
  284.                     {
  285.                         count_array[19]++;
  286.                         array[index1]->odds++;
  287.                         array[index1]->whites++;
  288.                     } continue;
  289.                     
  290.                 case 20:
  291.                     {
  292.                         count_array[20]++;
  293.                         array[index1]->evens++;
  294.                         array[index1]->whites++;
  295.                     } continue;
  296.                     
  297.                 case 21:
  298.                     {
  299.                         count_array[21]++;
  300.                         array[index1]->odds++;
  301.                         array[index1]->whites++;
  302.                     } continue;
  303.                     
  304.                 case 22:
  305.                     {
  306.                         count_array[22]++;
  307.                         array[index1]->evens++;
  308.                         array[index1]->whites++;
  309.                     } continue;
  310.                     
  311.                 case 23:
  312.                     {
  313.                         count_array[23]++;
  314.                         array[index1]->odds++;
  315.                         array[index1]->whites++;
  316.                     } continue;
  317.                     
  318.                 case 24:
  319.                     {
  320.                         count_array[24]++;
  321.                         array[index1]->evens++;
  322.                         array[index1]->whites++;
  323.                     } continue;
  324.                     
  325.                 case 25:
  326.                     {
  327.                         count_array[25]++;
  328.                         array[index1]->odds++;
  329.                         array[index1]->whites++;
  330.                     } continue;
  331.                     
  332.                 case 26:
  333.                     {
  334.                         count_array[26]++;
  335.                         array[index1]->evens++;
  336.                         array[index1]->whites++;
  337.                     } continue;
  338.                     
  339.                 case 27:
  340.                     {
  341.                         count_array[27]++;
  342.                         array[index1]->odds++;
  343.                         array[index1]->whites++;
  344.                     } continue;
  345.                     
  346.                 case 28:
  347.                     {
  348.                         count_array[28]++;
  349.                         array[index1]->evens++;
  350.                         array[index1]->whites++;
  351.                     } continue;
  352.                     
  353.                 case 29:
  354.                     {
  355.                         count_array[29]++;
  356.                         array[index1]->odds++;
  357.                         array[index1]->whites++;
  358.                     } continue;
  359.                     
  360.                 case 30:
  361.                     {
  362.                         count_array[30]++;
  363.                         array[index1]->evens++;
  364.                         array[index1]->whites++;
  365.                     } continue;
  366.                     
  367.                 case 31:
  368.                     {
  369.                         count_array[31]++;
  370.                         array[index1]->odds++;
  371.                         array[index1]->whites++;
  372.                     } continue;
  373.                     
  374.                 case 32:
  375.                     {
  376.                         count_array[32]++;
  377.                         array[index1]->evens++;
  378.                         array[index1]->whites++;
  379.                     } continue;
  380.                     
  381.                 case 33:
  382.                     {
  383.                         count_array[33]++;
  384.                         array[index1]->odds++;
  385.                         array[index1]->whites++;
  386.                     } continue;
  387.                     
  388.                 case 34:
  389.                     {
  390.                         count_array[34]++;
  391.                         array[index1]->evens++;
  392.                         array[index1]->whites++;
  393.                     } continue;
  394.                                                     // end of whites
  395.                 case 35:
  396.                     {
  397.                         count_array[35]++;
  398.                         array[index1]->odds++;
  399.                         array[index1]->blues++;
  400.                     } continue;
  401.                     
  402.                 case 36:
  403.                     {
  404.                         count_array[36]++;
  405.                         array[index1]->evens++;
  406.                         array[index1]->blues++;
  407.                     } continue;
  408.                     
  409.                 case 37:
  410.                     {
  411.                         count_array[37]++;
  412.                         array[index1]->odds++;
  413.                         array[index1]->blues++;
  414.                     } continue;
  415.                     
  416.                 case 38:
  417.                     {
  418.                         count_array[38]++;
  419.                         array[index1]->evens++;
  420.                         array[index1]->blues++;
  421.                     } continue;
  422.                     
  423.                 case 39:
  424.                     {
  425.                         count_array[39]++;
  426.                         array[index1]->odds++;
  427.                         array[index1]->blues++;
  428.                     } continue;
  429.                     
  430.                 case 40:
  431.                     {
  432.                         count_array[40]++;
  433.                         array[index1]->evens++;
  434.                         array[index1]->blues++;
  435.                     } continue;
  436.                     
  437.                 case 41:
  438.                     {
  439.                         count_array[41]++;
  440.                         array[index1]->odds++;
  441.                         array[index1]->blues++;
  442.                     } continue;
  443.                     
  444.                 case 42:
  445.                     {
  446.                         count_array[42]++;
  447.                         array[index1]->evens++;
  448.                         array[index1]->blues++;
  449.                     } continue;
  450.                     
  451.                 case 43:
  452.                     {
  453.                         count_array[43]++;
  454.                         array[index1]->odds++;
  455.                         array[index1]->blues++;
  456.                     } continue;
  457.                     
  458.                 case 44:
  459.                     {
  460.                         count_array[44]++;
  461.                         array[index1]->evens++;
  462.                         array[index1]->blues++;
  463.                     } continue;
  464.                     
  465.                 case 45:
  466.                     {
  467.                         count_array[45]++;
  468.                         array[index1]->odds++;
  469.                         array[index1]->blues++;
  470.                     } continue;
  471.                     
  472.                 case 46:
  473.                     {
  474.                         count_array[46]++;
  475.                         array[index1]->evens++;
  476.                         array[index1]->blues++;
  477.                     } continue;
  478.                     
  479.                 case 47:
  480.                     {
  481.                         count_array[47]++;
  482.                         array[index1]->odds++;
  483.                         array[index1]->blues++;
  484.                     } continue;
  485.                     
  486.                 case 48: 
  487.                     {
  488.                         count_array[48]++;
  489.                         array[index1]->evens++;
  490.                         array[index1]->blues++;
  491.                     } continue;
  492.                 
  493.                 case 49:
  494.                     {
  495.                         count_array[49]++;
  496.                         array[index1]->odds++;
  497.                         array[index1]->blues++;
  498.                     } continue;
  499.                     
  500.                 case 50:
  501.                     {
  502.                         count_array[50]++;
  503.                         array[index1]->evens++;
  504.                         array[index1]->blues++;
  505.                     } continue;
  506.                     
  507.                 case 51:
  508.                     {
  509.                         count_array[51]++;
  510.                         array[index1]->odds++;
  511.                         array[index1]->blues++;
  512.                     } continue;
  513.                 
  514.                 default: break;
  515.             }
  516.         }
  517.     }
  518.     
  519.         cout << endl << endl;
  520.         cout << "Here are the statistics on the ten previous draws: " << endl << endl;
  521.         int index4;
  522.         for( index4 = 0; index4 < 10; index4++ )
  523.         {
  524.             cout << "Set " << index4 + 1;
  525.             if( (index4 + 1) < 10 ) cout << ' ';
  526.             cout << "  odds = " << array[index4]->odds
  527.             << "  evens = " << array[index4]->evens
  528.             << "  whites = " << array[index4]->whites
  529.             << "  blues = " << array[index4]->blues
  530.             << "  reds = " << array[index4]->reds
  531.             << endl;
  532.         }
  533.         
  534.         cout << endl << endl;
  535.         cout << "The number distribution is: " << endl;
  536.         int index5;
  537.         for( index5 = 1; index5 < 52; index5++ ) // on count_array, 0 and 52 are omitted
  538.         {
  539.             cout << "Number ";
  540.             if( index5 < 10 ) cout << ' ';
  541.             cout << index5 << " = " << count_array[index5] << "   ";
  542.             if( (index5 % 5) == 0 ) cout << endl;
  543.         }
  544.         
  545.         cout << endl << endl << endl;
  546.         
  547.         cout << "The number distributions as sets are: " << endl;
  548.         cout << "( Don't be mislead, only data from the last ten sets are used here!!! )" << endl;
  549.         cout << "Only compare the numbers of 1's here with the numbers of 0's on the new set!!" << endl;
  550.         for( int pez1 = 0; pez1 < 10; pez1++ )
  551.         {
  552.             cout << "Set #";
  553.             if( (pez1 + 1) < 10 ) cout << ' ';
  554.             cout << (pez1 + 1) << " =  ";
  555.             for( int pez2 = 0; pez2 < 6; pez2++ )
  556.             {
  557.                 cout << (count_array[(array[pez1]->set[pez2])]) << ' ';
  558.             }
  559.             cout << endl;
  560.         }
  561.         
  562.         cout << endl << endl;
  563.             
  564.         
  565.         int index6;
  566.         int temp;
  567.         for( index6 = 0; index6 < 10; index6++ )
  568.         {
  569.             temp = 0;
  570.             temp += (array[index6]->set[1] - array[index6]->set[0]);
  571.             temp += (array[index6]->set[2] - array[index6]->set[1]);
  572.             temp += (array[index6]->set[3] - array[index6]->set[2]);
  573.             temp += (array[index6]->set[4] - array[index6]->set[3]);
  574.             temp += (array[index6]->set[5] - array[index6]->set[4]);
  575.             
  576.             array[index6]->sum_of_diffs = temp;
  577.             
  578.             cout << "Number Set ";
  579.             if( (index6 + 1) < 10 ) cout << ' ';
  580.             cout << index6 + 1 << " sum of differences = ";
  581.             if( array[index6]->sum_of_diffs < 10 ) cout << ' ';
  582.             cout << array[index6]->sum_of_diffs << endl;
  583.             
  584.         }
  585.         
  586.         cout << endl;
  587.         
  588.         int index7;
  589.         for( index7 = 0; index7 < 10; index7++ )
  590.         {
  591.             float sum = 0;
  592.             int summer = 0;
  593.             
  594.             for( summer = 0; summer < 6; summer++ )
  595.             {
  596.                 sum += array[index7]->set[summer];
  597.             }
  598.             array[index7]->average = (( sum / 6 ) + .5);
  599.             cout << "The average of Number Set "; 
  600.             if( (index7 + 1) < 10 ) cout << ' ';
  601.             cout << index7 + 1 << " is: ";
  602.             if( array[index7]->average < 10 ) cout << ' ';
  603.             cout << array[index7]->average << endl;
  604.         }
  605.         
  606. /****************** END OF ORIGINAL NUMBER SET CALCULATIONS ***************************/
  607.  
  608.  
  609.  
  610.  
  611.  
  612.         
  613.         // clear out the temporary buffer    
  614.     for( int phase1 = 0; phase1 < 10; phase1++ )
  615.     {
  616.         for( int phase2 = 0; phase2 < 6; phase2++ )
  617.         {
  618.             nums[phase1][phase2] = 0;
  619.         }
  620.     }
  621.         
  622.     // seed the rand
  623.     seed = time( curtime );
  624.     srand( seed );
  625.     
  626.     int ind1 = 0;
  627.     int ind2 = 0;
  628.     int pick1 = 0;
  629.     int getnum = 0;
  630.     int quit = 0;
  631.     
  632. for( ind2 = 0; ind2 < 10; ind2++ )  // ********* START OF GENERATE NEW NUMBERS 
  633. {    
  634.     for( ind1 = 0; ind1 < 6; ind1++ )
  635.     {
  636.         do {
  637.             pick1 = ( 1 + rand() % 18 );
  638.             }while( pick1 < 1 || pick1 > 18 );
  639.             
  640.         switch( pick1 )
  641.         {
  642.             case 1:  // get a 1 distrib.
  643.                 {
  644.                     while( count_array[getnum] != 1 && quit < 100 )
  645.                     {
  646.                         do {
  647.                             getnum = (1 + rand() % 51);
  648.                             }while( getnum < 1 || getnum > 51 );
  649.                         quit++;
  650.                     }
  651.                     if( count_array[getnum] == 1 )
  652.                     {
  653.                         nums[ind2][ind1] = getnum;
  654.                     } else {
  655.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  656.                         }
  657.                 getnum = 0;
  658.                 quit = 0;
  659.                 } break;
  660.                 
  661.             case 2:  // get a red
  662.                 {
  663.                     while( getnum < 1 || getnum > 17 )
  664.                     {
  665.                         getnum = (1 + rand() % 17);
  666.                     }
  667.                     if( getnum > 0 && getnum < 18 )
  668.                     {
  669.                         nums[ind2][ind1] = getnum;
  670.                     } else {
  671.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  672.                         }
  673.                 getnum = 0;
  674.                 } break;
  675.                 
  676.             case 3: // get a 0 distrib.
  677.                 {
  678.                     while( count_array[getnum] != 0 && quit < 100 )
  679.                     {
  680.                         getnum = ( 1 + rand() % 51 );
  681.                         quit++;
  682.                     }
  683.                     if( count_array[getnum] == 0 )
  684.                     {
  685.                         nums[ind2][ind1] = getnum;
  686.                     } else {
  687.                         nums[ind2][ind1] = ( 1 +rand() % 51 );
  688.                         }
  689.                 getnum = 0;
  690.                 quit = 0;
  691.                 } break;
  692.             
  693.             case 4:  // get a white
  694.                 {
  695.                     while( getnum < 18 || getnum > 34 )
  696.                     {
  697.                         getnum = rand() % 34;
  698.                     }
  699.                     if( getnum > 17 && getnum < 35 )
  700.                     {
  701.                         nums[ind2][ind1] = getnum;
  702.                     } else {
  703.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  704.                         }
  705.                 getnum = 0;
  706.                 } break;
  707.                 
  708.             case 5:  // get a 1 distrib.
  709.                 {
  710.                     while( count_array[getnum] != 1 && quit < 100 )
  711.                     {
  712.                         getnum = ( 1 + rand() % 51 );
  713.                         quit++;
  714.                     }
  715.                     if( count_array[getnum] == 1 )
  716.                     {
  717.                         nums[ind2][ind1] = getnum;
  718.                     } else {
  719.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  720.                         }
  721.                 getnum = 0;
  722.                 quit = 0;
  723.                 } break;
  724.                 
  725.             case 6: // get a 0 distrib.
  726.                 {
  727.                     while( count_array[getnum] != 0 && quit < 100 )
  728.                     {
  729.                         getnum = ( 1 + rand() % 51 );
  730.                         quit++;
  731.                     }
  732.                     if( count_array[getnum] == 0 )
  733.                     {
  734.                         nums[ind2][ind1] = getnum;
  735.                     } else {
  736.                         nums[ind2][ind1] = ( 1 +rand() % 51 );
  737.                         }
  738.                 getnum = 0;
  739.                 quit = 0;
  740.                 } break;
  741.                 
  742.             case 7: // get a two dist
  743.                 {
  744.                     while( count_array[getnum] != 2 && quit < 100 )
  745.                     {
  746.                         getnum = ( 1 + rand() % 51 );
  747.                         quit++;
  748.                     }
  749.                     if( count_array[getnum] == 2 )
  750.                     {
  751.                         nums[ind2][ind1] = getnum;
  752.                     } else {
  753.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  754.                         }
  755.                 getnum = 0;
  756.                 quit = 0;
  757.                 } break;    
  758.                 
  759.             case 8:  // get a white
  760.                 {
  761.                     while( getnum < 18 || getnum > 34 )
  762.                     {
  763.                         getnum = rand() % 34;
  764.                     }
  765.                     if( getnum > 17 && getnum < 35 )
  766.                     {
  767.                         nums[ind2][ind1] = getnum;
  768.                     } else {
  769.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  770.                         }
  771.                 getnum = 0;
  772.                 } break;
  773.                 
  774.             case 9: // get a 4 distrib.
  775.                 {
  776.                     while( count_array[getnum] != 4 && quit < 100 )
  777.                     {
  778.                         getnum = ( 1 + rand() % 51 );
  779.                         quit++;
  780.                     }
  781.                     if( count_array[getnum] == 4 )
  782.                     {
  783.                         nums[ind2][ind1] = getnum;
  784.                     } else {
  785.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  786.                         }
  787.                 getnum = 0;
  788.                 quit = 0;
  789.                 } break;
  790.                 
  791.             case 10:  // get a red
  792.                 {
  793.                     while( getnum < 1 || getnum > 17 )
  794.                     {
  795.                         getnum = rand() % 17;
  796.                     }
  797.                     if( getnum > 0 && getnum < 18 )
  798.                     {
  799.                         nums[ind2][ind1] = getnum;
  800.                     } else {
  801.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  802.                         }
  803.                 getnum = 0;
  804.                 } break;
  805.                 
  806.             case 11: // get one of the numbers from the last draw
  807.                 {
  808.                     int something = 0;
  809.                     while( something < 1 || something > 6 )
  810.                     {
  811.                         something = ( 1 + rand() % 6 );
  812.                     }
  813.                     nums[ind2][ind1] = array[0]->set[something - 1];
  814.                 } break;
  815.                     
  816.             case 12:  // get a three dist.
  817.                 {
  818.                     while( count_array[getnum] != 3 && quit < 100 )
  819.                     {
  820.                         getnum = ( 1 + rand() % 51 );
  821.                         quit++;
  822.                     }
  823.                     if( count_array[getnum] == 3 )
  824.                     {
  825.                         nums[ind2][ind1] = getnum;
  826.                     } else {
  827.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  828.                         }
  829.                 getnum = 0;
  830.                 quit = 0;
  831.                 } break;
  832.                 
  833.                 case 13: // get one from the next to last draw
  834.                     {
  835.                         int something = 0;
  836.                         while( something < 1 || something > 6 )
  837.                         {
  838.                             something = ( 1 + rand() % 6 );
  839.                         }
  840.                         nums[ind2][ind1] = array[1]->set[something - 1];
  841.                     } break;
  842.                     
  843.                 case 14:  // get a 1 dist
  844.                 {
  845.                     while( count_array[getnum] != 1 && quit < 100 )
  846.                     {
  847.                         do {
  848.                             getnum = (1 + rand() % 51);
  849.                             }while( getnum < 1 || getnum > 51 );
  850.                         quit++;
  851.                     }
  852.                     if( count_array[getnum] == 1 )
  853.                     {
  854.                         nums[ind2][ind1] = getnum;
  855.                     } else {
  856.                         nums[ind2][ind1] = ( 1 + rand() % 51 );
  857.                         }
  858.                 getnum = 0;
  859.                 quit = 0;
  860.                 } break;
  861.                     
  862.                 case 15: // get one from the third to the last draw
  863.                     {
  864.                         int something = 0;
  865.                         while( something < 1 || something > 6 )
  866.                         {
  867.                             something = ( 1 + rand() % 6 );
  868.                         }
  869.                         nums[ind2][ind1] = array[2]->set[something - 1];
  870.                     } break;
  871.                     
  872.                 case 16:  // get a two dist
  873.                     {
  874.                         while( count_array[getnum] != 2 && quit < 100 )
  875.                         {
  876.                             getnum = rand() % 51;
  877.                             quit++;
  878.                         }
  879.                         if( count_array[getnum] == 0 )
  880.                         {
  881.                             nums[ind2][ind1] = getnum;
  882.                         } else {
  883.                             nums[ind2][ind1] = ( 1 + rand() % 51 );
  884.                             }
  885.                     getnum = 0;
  886.                     quit = 0;
  887.                     } break;
  888.                     
  889.                 case 17:  // get a one dist
  890.                     {
  891.                         while( count_array[getnum] != 1 && quit < 100 )
  892.                         {
  893.                             do {
  894.                             getnum = (1 + rand() % 51);
  895.                             }while( getnum < 1 || getnum > 51 );
  896.                             quit++;
  897.                         }
  898.                         if( count_array[getnum] == 1 )
  899.                         {
  900.                             nums[ind2][ind1] = getnum;
  901.                         } else {
  902.                             nums[ind2][ind1] = ( 1 + rand() % 51 );
  903.                             }
  904.                     getnum = 0;
  905.                     quit = 0;
  906.                     } break;
  907.                 
  908.                 case 18: // get a 0 distrib.
  909.                 {
  910.                     while( count_array[getnum] != 0 && quit < 100 )
  911.                     {
  912.                         getnum = ( 1 + rand() % 51 );
  913.                         quit++;
  914.                     }
  915.                     if( count_array[getnum] == 0 )
  916.                     {
  917.                         nums[ind2][ind1] = getnum;
  918.                     } else {
  919.                         nums[ind2][ind1] = ( 1 +rand() % 51 );
  920.                         }
  921.                 getnum = 0;
  922.                 quit = 0;
  923.                 } break;
  924.                         
  925.             default: 
  926.                 {
  927.                     break;
  928.                 }
  929.                         
  930.         }
  931.         if( nums[ind2][0] == 0 )
  932.         {
  933.             while( nums[ind2][ind1] < 1 || nums[ind2][ind1] > 17 )
  934.                     {
  935.                         nums[ind2][ind1] = ( 1 + rand() % 17 ); // just get a rand
  936.                     }
  937.                     getnum = 0;
  938.                     quit = 0;
  939.         } else {
  940.             if( nums[ind2][ind1] == 0 )
  941.             {
  942.                 while( nums[ind2][ind1] < 1 || nums[ind2][ind1] > 51 )
  943.                     {
  944.                         nums[ind2][ind1] = ( 1 + rand() % 51 ); // just get a rand
  945.                     }
  946.                     getnum = 0;
  947.                     quit = 0;
  948.             }
  949.         }
  950.     }
  951. }
  952.  
  953.  
  954. // cycle through the numbers checking for out - of - parameters 
  955.     
  956.     int ind3 = 0;
  957.     int ind4 = 0;
  958.     int anum = 0;
  959.     int lastnum = 0;
  960.     int do_again = 1;
  961.     
  962.         // this do while loop should not let any duplicates or out-of-params slip through
  963. do {
  964.     do_again = 0; // start with 0 then change to one when a correction is made
  965.     
  966.     for( ind4 = 0; ind4 < 10; ind4++ )
  967.     {
  968.         for( ind3 = 0; ind3 < 6; ind3++ )
  969.         {
  970.             if( nums[ind4][ind3] < 1 || nums[ind4][ind3] > 51 || nums[ind4][ind3] == 0 )
  971.             {
  972.                 nums[ind4][ind3] = ( 1 + rand() % 51 );
  973.                 do_again = 1;
  974.             }
  975.         }
  976.     }
  977.  
  978.  
  979.    // check for duplicates
  980.     for( int pass3 = 0; pass3 < 10; pass3++ )        // check 0 against 1 - 5
  981.     {
  982.         for( int pass4 = 1; pass4 < 6; pass4++ )
  983.         {
  984.             if( nums[pass3][0] == nums[pass3][pass4] )
  985.             {
  986.                 nums[pass3][pass4] =( 1 + rand() % 51 );
  987.                 do_again = 1;
  988.             }
  989.         }
  990.     }
  991.     
  992.     for( int pass5 = 0; pass5 < 10; pass5++ )     // check 1 agaainst 2 - 5
  993.     {
  994.         for( int pass6 = 2; pass6 < 6; pass6++ )
  995.         {
  996.             if( nums[pass5][1] == nums[pass5][pass6] )
  997.             {
  998.                 nums[pass5][pass6] = ( 1 + rand() % 51 );
  999.                 do_again = 1;
  1000.             }
  1001.         }
  1002.     }
  1003.     
  1004.     for( int pass7 = 0; pass7 < 10; pass7++ )        // check 2 against 3 - 5
  1005.     {
  1006.         for( int pass8 = 3; pass8 < 6; pass8++ )
  1007.         {
  1008.             if( nums[pass7][2] == nums[pass7][pass8] )
  1009.             {
  1010.                 nums[pass7][pass8] = ( 1 + rand() % 51 );
  1011.                 do_again = 1;
  1012.             }
  1013.         }
  1014.     }
  1015.     
  1016.     for( int pass9 = 0; pass9 < 10; pass9++ )        // check 3 against 4 - 5
  1017.     {
  1018.         for( int pass10 = 4; pass10 < 6; pass10++ )
  1019.         {
  1020.             if( nums[pass9][3] == nums[pass9][pass10] )
  1021.             {
  1022.                 nums[pass9][pass10] = ( 1 + rand() % 51 );
  1023.                 do_again = 1;
  1024.             }
  1025.         }
  1026.     }
  1027.     
  1028.     for( int pass11 = 0; pass11 < 10; pass11++ )   // check 4 against 5
  1029.     {
  1030.         if( nums[pass11][4] == nums[pass11][5] )
  1031.         {
  1032.             nums[pass11][5] = ( 1 + rand() % 51 );
  1033.             do_again = 1;
  1034.         }
  1035.     } 
  1036.     
  1037.     // cycle through the numbers checking for out - of - parameters 
  1038.     ind3 = 0;
  1039.     ind4 = 0;
  1040.     anum = 0;
  1041.     lastnum = 0;
  1042.     
  1043.     for( ind4 = 0; ind4 < 10; ind4++ )
  1044.     {
  1045.         for( ind3 = 0; ind3 < 6; ind3++ )
  1046.         {
  1047.             if( nums[ind4][ind3] < 1 || nums[ind4][ind3] > 51 || nums[ind4][ind3] == 0 )
  1048.             {
  1049.                 nums[ind4][ind3] = ( 1 + rand() % 51 );
  1050.                 do_again = 1;
  1051.             }
  1052.         }
  1053.     }
  1054. } while( do_again == 1 );  // if any corrections made, do it again
  1055.  
  1056. // end of do_again loop
  1057.     // this sets up the array of pointers to structs
  1058.     for( index = 0; index < 10; index++ )
  1059.     {
  1060.         array2[index] =  new struct lottonum2;
  1061.         array2[index]->odds2 = 0;
  1062.         array2[index]->evens2 = 0;
  1063.         array2[index]->reds2 = 0;
  1064.         array2[index]->whites2 = 0;
  1065.         array2[index]->blues2 = 0;
  1066.         array2[index]->average2 = 0;
  1067.         array2[index]->sum_of_diffs2 = 0;
  1068.         array2[index]->use = 0;
  1069.         
  1070.         
  1071.             switch( index )
  1072.             {
  1073.                 case 0:
  1074.                     {
  1075.                         array2[index]->next2 = array2[index + 1];
  1076.                         array2[index]->prev2 = 0;
  1077.                     } break;
  1078.                     
  1079.                 case 9:
  1080.                     {
  1081.                         array2[index]->prev2 = array2[index - 1];
  1082.                         array2[index]->next2 = 0;
  1083.                     } break;
  1084.                     
  1085.                 default:
  1086.                     {
  1087.                         array2[index]->next2 = array2[index + 1];
  1088.                         array2[index]->prev2 = array2[index - 1];
  1089.                     } break;
  1090.                 
  1091.             }
  1092.     }
  1093.     
  1094.     // load the array into the second struct    
  1095.     for( int iter1 = 0; iter1 < 10; iter1++ )
  1096.     {
  1097.         for( int iter2 = 0; iter2 < 6; iter2++ )
  1098.         {
  1099.             array2[iter1]->set2[iter2] = nums[iter1][iter2];
  1100.         }
  1101.     }
  1102.     
  1103.     int hold3 = 0;  // another simple bubble sort here
  1104.         
  1105.         
  1106.         for( int pass17 = 0; pass17 < 10; pass17++ )
  1107.         {
  1108.             for( int pass18 = 0; pass18 < 6; pass18++ )
  1109.             {
  1110.                 for( int d3 = 0; d3 < (6 - 1); d3++ )
  1111.                 {
  1112.                     if( array2[pass17]->set2[d3] > array2[pass17]->set2[d3+1] )
  1113.                     {
  1114.                         hold3 = array2[pass17]->set2[d3];
  1115.                         array2[pass17]->set2[d3] = array2[pass17]->set2[d3 + 1];
  1116.                         array2[pass17]->set2[d3 + 1] = hold3;
  1117.                     }
  1118.                 }
  1119.             }
  1120.         }
  1121.         
  1122.         
  1123.         
  1124.         
  1125.     int pickanum = 0;
  1126.     
  1127.     for(int x1 = 0; x1 < 5; x1++ )  // try an initial group of five sets
  1128.     {
  1129.         pickanum = 0;
  1130.         
  1131.         do {
  1132.             pickanum = rand() % 15;
  1133.         } while( pickanum < 1 || pickanum > 9 || (array2[pickanum]->use == 1) );
  1134.         
  1135.         array2[pickanum]->use = 1;
  1136.         
  1137.     }
  1138.     
  1139.     
  1140.     int fixit = 0;    
  1141.     int somenum = 0;
  1142.     int redoctr = 0;
  1143.     int toomany = 0;
  1144.     
  1145.     // try to make sure we have at least one set with equal odds & evens
  1146.     int need3odd = 1; // true until we prove it false
  1147.     
  1148.     redo:        
  1149.     
  1150.     // this counts the occurrances of numbers in the sets
  1151.     // count_array2[]:
  1152.     // 0 is ommitted to make count_array easier to understand
  1153.     // 52 is ommitted to make room for the NULL terminator in count_array
  1154.     index1 = 0;
  1155.     index2 = 0;  // just to be sure 
  1156.     for( int razz1 = 0; razz1 < 52; razz1++ )
  1157.     {
  1158.         count_array2[razz1] = NULL;
  1159.     }
  1160.     
  1161.     for( int razz4 = 0; razz4 < 10; razz4++ )
  1162.     {
  1163.         array2[razz4]->odds2 = NULL;
  1164.         array2[razz4]->evens2 = NULL;
  1165.         array2[razz4]->reds2 = NULL;
  1166.         array2[razz4]->whites2 = NULL;
  1167.         array2[razz4]->blues2 = NULL;
  1168.     }
  1169.     
  1170.     for( index1 = 0; index1 < 10; index1++ )
  1171.     {
  1172.         for( index2 = 0; index2 < 6; index2++ )
  1173.         {
  1174.             switch( array2[index1]->set2[index2] )
  1175.             {
  1176.                 case 1: 
  1177.                     {
  1178.                         count_array2[1]++;
  1179.                         array2[index1]->odds2++;
  1180.                         (array2[index1]->reds2++);
  1181.                     } continue;
  1182.                     
  1183.                 case 2:
  1184.                     {
  1185.                         count_array2[2]++;
  1186.                         array2[index1]->evens2++;
  1187.                         (array2[index1]->reds2++);
  1188.                     } continue;
  1189.                     
  1190.                 case 3: 
  1191.                     {
  1192.                         count_array2[3]++;
  1193.                         array2[index1]->odds2++;
  1194.                         (array2[index1]->reds2++);
  1195.                     } continue;
  1196.                     
  1197.                 case 4: 
  1198.                     {
  1199.                         count_array2[4]++;
  1200.                         array2[index1]->evens2++;
  1201.                         (array2[index1]->reds2++);
  1202.                     } continue;
  1203.                     
  1204.                 case 5: 
  1205.                     {
  1206.                         count_array2[5]++;
  1207.                         array2[index1]->odds2++;
  1208.                         (array2[index1]->reds2++);
  1209.                     } continue;
  1210.                     
  1211.                 case 6: 
  1212.                     {
  1213.                         count_array2[6]++;
  1214.                         array2[index1]->evens2++;
  1215.                         (array2[index1]->reds2++);
  1216.                     } continue;
  1217.                     
  1218.                 case 7: 
  1219.                     {
  1220.                         count_array2[7]++;
  1221.                         array2[index1]->odds2++;
  1222.                         (array2[index1]->reds2++);
  1223.                     } continue;
  1224.                     
  1225.                 case 8: 
  1226.                     {
  1227.                         count_array2[8]++;
  1228.                         array2[index1]->evens2++;
  1229.                         (array2[index1]->reds2++);
  1230.                     } continue;
  1231.                     
  1232.                 case 9: 
  1233.                     {
  1234.                         count_array2[9]++;
  1235.                         array2[index1]->odds2++;
  1236.                         (array2[index1]->reds2++);
  1237.                     } continue;
  1238.                     
  1239.                 case 10: 
  1240.                     {
  1241.                         count_array2[10]++;
  1242.                         array2[index1]->evens2++;
  1243.                         (array2[index1]->reds2++);
  1244.                     } continue;
  1245.                     
  1246.                 case 11: 
  1247.                     {
  1248.                         count_array2[11]++;
  1249.                         array2[index1]->odds2++;
  1250.                         (array2[index1]->reds2++);
  1251.                     } continue;
  1252.                     
  1253.                 case 12: 
  1254.                     {
  1255.                         count_array2[12]++;
  1256.                         array2[index1]->evens2++;
  1257.                         (array2[index1]->reds2++);
  1258.                     } continue;
  1259.                     
  1260.                 case 13: 
  1261.                     {
  1262.                         count_array2[13]++;
  1263.                         array2[index1]->odds2++;
  1264.                         (array2[index1]->reds2++);
  1265.                     } continue;
  1266.                     
  1267.                 case 14: 
  1268.                     {
  1269.                         count_array2[14]++;
  1270.                         array2[index1]->evens2++;
  1271.                         (array2[index1]->reds2++);
  1272.                     } continue;
  1273.                     
  1274.                 case 15: 
  1275.                     {
  1276.                         count_array2[15]++;
  1277.                         array2[index1]->odds2++;
  1278.                         (array2[index1]->reds2++);
  1279.                     } continue;
  1280.                 
  1281.                 case 16:
  1282.                     {
  1283.                         count_array2[16]++;
  1284.                         array2[index1]->evens2++;
  1285.                         (array2[index1]->reds2++);
  1286.                     } continue;
  1287.                     
  1288.                 case 17:
  1289.                     {
  1290.                         count_array2[17]++;
  1291.                         array2[index1]->odds2++;
  1292.                         (array2[index1]->reds2++);
  1293.                     } continue;
  1294.                                                 // end of reds
  1295.                 case 18:
  1296.                     {
  1297.                         count_array2[18]++;
  1298.                         array2[index1]->evens2++;
  1299.                         (array2[index1]->whites2++);
  1300.                     } continue;
  1301.                     
  1302.                 case 19:
  1303.                     {
  1304.                         count_array2[19]++;
  1305.                         array2[index1]->odds2++;
  1306.                         (array2[index1]->whites2++);
  1307.                     } continue;
  1308.                     
  1309.                 case 20:
  1310.                     {
  1311.                         count_array2[20]++;
  1312.                         array2[index1]->evens2++;
  1313.                         (array2[index1]->whites2++);
  1314.                     } continue;
  1315.                     
  1316.                 case 21:
  1317.                     {
  1318.                         count_array2[21]++;
  1319.                         array2[index1]->odds2++;
  1320.                         (array2[index1]->whites2++);
  1321.                     } continue;
  1322.                     
  1323.                 case 22:
  1324.                     {
  1325.                         count_array2[22]++;
  1326.                         array2[index1]->evens2++;
  1327.                         (array2[index1]->whites2++);
  1328.                     } continue;
  1329.                     
  1330.                 case 23:
  1331.                     {
  1332.                         count_array2[23]++;
  1333.                         array2[index1]->odds2++;
  1334.                         (array2[index1]->whites2++);
  1335.                     } continue;
  1336.                     
  1337.                 case 24:
  1338.                     {
  1339.                         count_array2[24]++;
  1340.                         array2[index1]->evens2++;
  1341.                         (array2[index1]->whites2++);
  1342.                     } continue;
  1343.                     
  1344.                 case 25:
  1345.                     {
  1346.                         count_array2[25]++;
  1347.                         array2[index1]->odds2++;
  1348.                         (array2[index1]->whites2++);
  1349.                     } continue;
  1350.                     
  1351.                 case 26:
  1352.                     {
  1353.                         count_array2[26]++;
  1354.                         array2[index1]->evens2++;
  1355.                         (array2[index1]->whites2++);
  1356.                     } continue;
  1357.                     
  1358.                 case 27:
  1359.                     {
  1360.                         count_array2[27]++;
  1361.                         array2[index1]->odds2++;
  1362.                         (array2[index1]->whites2++);
  1363.                     } continue;
  1364.                     
  1365.                 case 28:
  1366.                     {
  1367.                         count_array2[28]++;
  1368.                         array2[index1]->evens2++;
  1369.                         (array2[index1]->whites2++);
  1370.                     } continue;
  1371.                     
  1372.                 case 29:
  1373.                     {
  1374.                         count_array2[29]++;
  1375.                         array2[index1]->odds2++;
  1376.                         (array2[index1]->whites2++);
  1377.                     } continue;
  1378.                     
  1379.                 case 30:
  1380.                     {
  1381.                         count_array2[30]++;
  1382.                         array2[index1]->evens2++;
  1383.                         (array2[index1]->whites2++);
  1384.                     } continue;
  1385.                     
  1386.                 case 31:
  1387.                     {
  1388.                         count_array2[31]++;
  1389.                         array2[index1]->odds2++;
  1390.                         (array2[index1]->whites2++);
  1391.                     } continue;
  1392.                     
  1393.                 case 32:
  1394.                     {
  1395.                         count_array2[32]++;
  1396.                         array2[index1]->evens2++;
  1397.                         (array2[index1]->whites2++);
  1398.                     } continue;
  1399.                     
  1400.                 case 33:
  1401.                     {
  1402.                         count_array2[33]++;
  1403.                         array2[index1]->odds2++;
  1404.                         (array2[index1]->whites2++);
  1405.                     } continue;
  1406.                     
  1407.                 case 34:
  1408.                     {
  1409.                         count_array2[34]++;
  1410.                         array2[index1]->evens2++;
  1411.                         (array2[index1]->whites2++);
  1412.                     } continue;
  1413.                                                     // end of whites
  1414.                 case 35:
  1415.                     {
  1416.                         count_array2[35]++;
  1417.                         array2[index1]->odds2++;
  1418.                         (array2[index1]->blues2++);
  1419.                     } continue;
  1420.                     
  1421.                 case 36:
  1422.                     {
  1423.                         count_array2[36]++;
  1424.                         array2[index1]->evens2++;
  1425.                         (array2[index1]->blues2++);
  1426.                     } continue;
  1427.                     
  1428.                 case 37:
  1429.                     {
  1430.                         count_array2[37]++;
  1431.                         array2[index1]->odds2++;
  1432.                         (array2[index1]->blues2++);
  1433.                     } continue;
  1434.                     
  1435.                 case 38:
  1436.                     {
  1437.                         count_array2[38]++;
  1438.                         array2[index1]->evens2++;
  1439.                         (array2[index1]->blues2++);
  1440.                     } continue;
  1441.                     
  1442.                 case 39:
  1443.                     {
  1444.                         count_array2[39]++;
  1445.                         array2[index1]->odds2++;
  1446.                         (array2[index1]->blues2++);
  1447.                     } continue;
  1448.                     
  1449.                 case 40:
  1450.                     {
  1451.                         count_array2[40]++;
  1452.                         array2[index1]->evens2++;
  1453.                         (array2[index1]->blues2++);
  1454.                     } continue;
  1455.                     
  1456.                 case 41:
  1457.                     {
  1458.                         count_array2[41]++;
  1459.                         array2[index1]->odds2++;
  1460.                         (array2[index1]->blues2++);
  1461.                     } continue;
  1462.                     
  1463.                 case 42:
  1464.                     {
  1465.                         count_array2[42]++;
  1466.                         array2[index1]->evens2++;
  1467.                         (array2[index1]->blues2++);
  1468.                     } continue;
  1469.                     
  1470.                 case 43:
  1471.                     {
  1472.                         count_array2[43]++;
  1473.                         array2[index1]->odds2++;
  1474.                         (array2[index1]->blues2++);
  1475.                     } continue;
  1476.                     
  1477.                 case 44:
  1478.                     {
  1479.                         count_array2[44]++;
  1480.                         array2[index1]->evens2++;
  1481.                         (array2[index1]->blues2++);
  1482.                     } continue;
  1483.                     
  1484.                 case 45:
  1485.                     {
  1486.                         count_array2[45]++;
  1487.                         array2[index1]->odds2++;
  1488.                         (array2[index1]->blues2++);
  1489.                     } continue;
  1490.                     
  1491.                 case 46:
  1492.                     {
  1493.                         count_array2[46]++;
  1494.                         array2[index1]->evens2++;
  1495.                         (array2[index1]->blues2++);
  1496.                     } continue;
  1497.                     
  1498.                 case 47:
  1499.                     {
  1500.                         count_array2[47]++;
  1501.                         array2[index1]->odds2++;
  1502.                         (array2[index1]->blues2++);
  1503.                     } continue;
  1504.                     
  1505.                 case 48: 
  1506.                     {
  1507.                         count_array2[48]++;
  1508.                         array2[index1]->evens2++;
  1509.                         (array2[index1]->blues2++);
  1510.                     } continue;
  1511.                 
  1512.                 case 49:
  1513.                     {
  1514.                         count_array2[49]++;
  1515.                         array2[index1]->odds2++;
  1516.                         (array2[index1]->blues2++);
  1517.                     } continue;
  1518.                     
  1519.                 case 50:
  1520.                     {
  1521.                         count_array2[50]++;
  1522.                         array2[index1]->evens2++;
  1523.                         (array2[index1]->blues2++);
  1524.                     } continue;
  1525.                     
  1526.                 case 51:
  1527.                     {
  1528.                         count_array2[51]++;
  1529.                         array2[index1]->odds2++;
  1530.                         (array2[index1]->blues2++);
  1531.                     } continue;
  1532.                     
  1533.                 default: break;
  1534.             }
  1535.         }
  1536.     }                
  1537.  
  1538. do {
  1539.     fixit = 0;
  1540.     for( int apass1 = 0; apass1 < 10; apass1++ ) // cycle thru all 10
  1541.     {
  1542.         if( array2[apass1]->use == 1 ) // look for a selected one
  1543.         {
  1544.             for( int apass2 = 0; apass2 < 10; apass2++ ) // cycle thru ten again
  1545.             {
  1546.                 if( array2[apass2]->use == 1 && apass1 != apass2 ) // if it is selected ...
  1547.                 {                                                  // and is not the same one
  1548.                     for( int apass3 = 0; apass3 < 6; apass3++ ) // look through six of the first
  1549.                     {
  1550.                         for( int apass4 = 0; apass4 < 6; apass4++ ) // check against 6 of second
  1551.                         {
  1552.                             if( array2[apass1]->set2[apass3] == array2[apass2]->set2[apass4] )
  1553.                             {
  1554.                                 do {
  1555.                                     somenum = 0;
  1556.                                     somenum = (1 + rand() % 51);
  1557.                                     } while( somenum < 1 || somenum > 51 );
  1558.                                 array2[apass1]->set2[apass3] = somenum;
  1559.                                 fixit = 1;
  1560.                             }
  1561.                         }
  1562.                     }
  1563.                 }
  1564.             }
  1565.         }
  1566.     }
  1567. } while( fixit == 1 );
  1568.     
  1569.     
  1570.     
  1571. // load the second struct into the array
  1572.     for( int iter1 = 0; iter1 < 10; iter1++ )
  1573.     {
  1574.         for( int iter2 = 0; iter2 < 6; iter2++ )
  1575.         {
  1576.             nums[iter1][iter2] = array2[iter1]->set2[iter2];
  1577.         }
  1578.     }                        
  1579.                             
  1580. // cycle through the numbers checking for out - of - parameters 
  1581.     
  1582.  ind3 = 0;
  1583.  ind4 = 0;
  1584.  anum = 0;
  1585.  lastnum = 0;
  1586.  do_again = 1;
  1587.     
  1588.         // this do while loop should not let any duplicates or out-of-params slip through
  1589. do {
  1590.     do_again = 0; // start with 0 then change to one when a correction is made
  1591.     
  1592.  
  1593.  
  1594.    // check for duplicates
  1595.     for( int pass3 = 0; pass3 < 10; pass3++ )        // check 0 against 1 - 5
  1596.     {
  1597.         for( int pass4 = 1; pass4 < 6; pass4++ )
  1598.         {
  1599.             if( nums[pass3][0] == nums[pass3][pass4] )
  1600.             {
  1601.                 nums[pass3][pass4] = ( 1 + rand() % 51 );
  1602.                 do_again = 1;
  1603.             }
  1604.         }
  1605.     }
  1606.     
  1607.     for( int pass5 = 0; pass5 < 10; pass5++ )     // check 1 agaainst 2 - 5
  1608.     {
  1609.         for( int pass6 = 2; pass6 < 6; pass6++ )
  1610.         {
  1611.             if( nums[pass5][1] == nums[pass5][pass6] )
  1612.             {
  1613.                 nums[pass5][pass6] = ( 1 + rand() % 51 );
  1614.                 do_again = 1;
  1615.             }
  1616.         }
  1617.     }
  1618.     
  1619.     for( int pass7 = 0; pass7 < 10; pass7++ )        // check 2 against 3 - 5
  1620.     {
  1621.         for( int pass8 = 3; pass8 < 6; pass8++ )
  1622.         {
  1623.             if( nums[pass7][2] == nums[pass7][pass8] )
  1624.             {
  1625.                 nums[pass7][pass8] = ( 1 + rand() % 51 );
  1626.                 do_again = 1;
  1627.             }
  1628.         }
  1629.     }
  1630.     
  1631.     for( int pass9 = 0; pass9 < 10; pass9++ )        // check 3 against 4 - 5
  1632.     {
  1633.         for( int pass10 = 4; pass10 < 6; pass10++ )
  1634.         {
  1635.             if( nums[pass9][3] == nums[pass9][pass10] )
  1636.             {
  1637.                 nums[pass9][pass10] = ( 1 + rand() % 51 );
  1638.                 do_again = 1;
  1639.             }
  1640.         }
  1641.     }
  1642.     
  1643.     for( int pass11 = 0; pass11 < 10; pass11++ )   // check 4 against 5
  1644.     {
  1645.         if( nums[pass11][4] == nums[pass11][5] )
  1646.         {
  1647.             nums[pass11][5] = ( 1 + rand() % 51 );
  1648.             do_again = 1;
  1649.         }
  1650.     } 
  1651.     
  1652. } while( do_again == 1 );  // if any corrections made, do it again    
  1653.  
  1654. // load the array into the second struct    
  1655.     for( int iter1 = 0; iter1 < 10; iter1++ )
  1656.     {
  1657.         for( int iter2 = 0; iter2 < 6; iter2++ )
  1658.         {
  1659.             array2[iter1]->set2[iter2] = nums[iter1][iter2];
  1660.         }
  1661.     }    
  1662.         
  1663.         
  1664.     int again = 0;
  1665.  
  1666. do {
  1667.     again = 0;
  1668.     for( int ant1 = 0; ant1 < 10; ant1++ )
  1669.     {
  1670.         if( array2[ant1]->use == 1 )
  1671.         {
  1672.             for( int ant2 = 0; ant2 < 10; ant2++ )
  1673.             {
  1674.                 if( array2[ant1]->set2[0] == array2[ant2]->set2[0] && ant1 != ant2 )
  1675.                 {
  1676.                     again = 1;
  1677.                     do {
  1678.                         array2[ant2]->set2[0] = ( 1 + rand() % (array2[ant2]->set2[1]) );
  1679.                         } while( (array2[ant2]->set2[0]) < 0 ||
  1680.                                 (array2[ant2]->set2[0]) > (array2[ant2]->set2[1]) );
  1681.                 }
  1682.             }
  1683.         }
  1684.     }
  1685. } while( again == 1 );    
  1686.  
  1687.  
  1688. for( int pas1 = 0; pas1 < 10; pas1++ )
  1689. {
  1690.     if( array2[pas1]->odds2 == 3 && array2[pas1]->use == 1 )
  1691.     {
  1692.         need3odd = 0; // yay! one of our chosen works, no need to try another
  1693.         toomany++;
  1694.         break;
  1695.     } else {
  1696.         need3odd = 1; // nope, got to find one
  1697.         }
  1698.     if( need3odd == 0 ) break; // if we got to here & it's 0, we found one ... get out of loop
  1699. }
  1700.  
  1701. int newtry = 20;  // just so we know we haven't got it yet..
  1702. if( need3odd == 1 )  //  we need to find one...
  1703. {
  1704.     for( int pas2 = 0; pas2 < 10; pas2++ )
  1705.     {
  1706.         if( array2[pas2]->use == 0 && array2[pas2]->odds2 == 3 && toomany < 2 )
  1707.         {
  1708.             do {
  1709.                 do {
  1710.                     newtry = ( rand() % 9 );
  1711.                 } while( newtry < 0 || newtry > 9 );
  1712.                     if( array2[newtry]->use != 1 ) newtry = 20; // random find a used one
  1713.             } while( newtry == 20 );
  1714.                 if( array2[newtry]->use == 1 ) // make sure we got a used one
  1715.                 {
  1716.                     array2[newtry]->use = 0;
  1717.                     array2[pas2]->use = 1;
  1718.                     need3odd = 0;
  1719.                     newtry = 20;
  1720.                     break; // no need to break
  1721.                 }
  1722.         }
  1723.     }
  1724. }
  1725.  
  1726. if( need3odd == 1 && redoctr <= 2 ) // try  2 times to find an even number of odds & evens
  1727. {
  1728.     redoctr++;
  1729.     goto redo; // try to make sure we don't have any matching numbers in the set
  1730. }
  1731.  
  1732.  
  1733. int bluescnt = 0;
  1734.  
  1735. for( int blu1 = 0; blu1 < 10; blu1++ )
  1736. {
  1737.     if( (array2[blu1]->blues2 > 2) && (array2[blu1]->use == 1) )
  1738.     {
  1739.         bluescnt++;
  1740.     }
  1741. }
  1742.  
  1743. if( bluescnt > 2 )
  1744. {
  1745.     do {
  1746.         for( int blu2 = 0; blu2 < 10; blu2++ )
  1747.         {
  1748.             if( (array2[blu2]->use == 1) && (array2[blu2]->blues2 > 2) )
  1749.             {
  1750.                 for( int blu3 = 0; blu3 < 6; blu3++ )
  1751.                 {
  1752.                     if( array2[blu2]->set2[blu3] > 34 && (array2[blu2]->blues2 > 2) )
  1753.                     {
  1754.                         if( (blu3 % 2) == 0 )
  1755.                         {
  1756.                             do {
  1757.                                     array2[blu2]->set2[blu3] = (1 + rand() % 17);
  1758.                                 } while( (array2[blu2]->set2[blu3] < 0) ||
  1759.                                              (array2[blu2]->set2[blu3] > 17) );
  1760.                             array2[blu2]->blues2--;
  1761.                         }
  1762.                             
  1763.                         if( (blu3 % 2) == 1 )
  1764.                         {
  1765.                             do {
  1766.                                         array2[blu2]->set2[blu3] = (1 + rand() % 34);
  1767.                                 } while( (array2[blu2]->set2[blu3] < 18) ||
  1768.                                              (array2[blu2]->set2[blu3] > 34) );
  1769.                             array2[blu2]->blues2--;
  1770.                         }
  1771.                     }
  1772.                 }
  1773.                 bluescnt--;
  1774.             }
  1775.         }
  1776.     } while( bluescnt > 2 );
  1777. }    
  1778.  
  1779. for( int last1 = 0; last1 < 10; last1++ )
  1780. {
  1781.     if( array2[last1]->use == 0 )
  1782.     {
  1783.         for( int last2 = 0; last2 < 6; last2++ )
  1784.         {
  1785.             for( int last3 = 0; last3 < 10; last3++ )
  1786.             {
  1787.                 if( (array2[last2]->use == 1) && (last1 != last2) )
  1788.                 {
  1789.                     for( int last4 = 0; last4 < 6; last4++ )
  1790.                     {
  1791.                         if( array2[last1]->set2[last2] == array2[last3]->set2[last4] )
  1792.                         {
  1793.                             do {
  1794.                                 array2[last1]->set2[last2] = (1 + rand() % 51);
  1795.                             } while( array2[last1]->set2[last2] < 1 ||
  1796.                                      array2[last1]->set2[last2] > 51 );
  1797.                         }
  1798.                     }
  1799.                 }
  1800.             }
  1801.         }
  1802.     }
  1803. }
  1804.  
  1805.  
  1806. for( int ez1 = 0; ez1 < 10; ez1++ )
  1807. {
  1808.     if( array2[ez1]->use == 0 )
  1809.     {
  1810.         for( int ez2 = 0; ez2 < 6; ez2++ )
  1811.         {
  1812.             for( int ez3 = 0; ez3 < 6; ez3++ )
  1813.             {
  1814.                 if( (ez2 != ez3) && (array2[ez1]->set2[ez2] == array2[ez1]->set2[ez3]) )
  1815.                 {
  1816.                     do {
  1817.                         array2[ez1]->set2[ez3] = (1 + rand() % 51); 
  1818.                     } while( array2[ez1]->set2[ez3] < 1 ||
  1819.                              array2[ez1]->set2[ez3] > 51 );
  1820.                 }
  1821.             }
  1822.         }
  1823.     }
  1824. }                     
  1825.                 
  1826.     int hold2 = 0;  // another simple bubble sort here
  1827.         
  1828.         
  1829.         for( int pass15 = 0; pass15 < 10; pass15++ )
  1830.         {
  1831.             for( int pass16 = 0; pass16 < 6; pass16++ )
  1832.             {
  1833.                 for( int d2 = 0; d2 < (6 - 1); d2++ )
  1834.                 {
  1835.                     if( array2[pass15]->set2[d2] > array2[pass15]->set2[d2+1] )
  1836.                     {
  1837.                         hold2 = array2[pass15]->set2[d2];
  1838.                         array2[pass15]->set2[d2] = array2[pass15]->set2[d2 + 1];
  1839.                         array2[pass15]->set2[d2 + 1] = hold2;
  1840.                     }
  1841.                 }
  1842.             }
  1843.         }
  1844.     
  1845.     
  1846.     
  1847.     // this counts the occurrances of numbers in the sets
  1848.     // count_array2[]:
  1849.     // 0 is ommitted to make count_array easier to understand
  1850.     // 52 is ommitted to make room for the NULL terminator in count_array
  1851.     index1 = 0;
  1852.     index2 = 0;  // just to be sure 
  1853.     for( int razz2 = 0; razz2 < 52; razz2++ )
  1854.     {
  1855.         count_array2[razz2] = NULL;
  1856.     }
  1857.     
  1858.     for( int razz3 = 0; razz3 < 10; razz3++ )
  1859.     {
  1860.         array2[razz3]->odds2 = NULL;
  1861.         array2[razz3]->evens2 = NULL;
  1862.         array2[razz3]->reds2 = NULL;
  1863.         array2[razz3]->whites2 = NULL;
  1864.         array2[razz3]->blues2 = NULL;
  1865.     }
  1866.     
  1867.     int theNumber = 0;
  1868.     for( index1 = 0; index1 < 10; index1++ )
  1869.     {
  1870.         for( index2 = 0; index2 < 6; index2++ )
  1871.         {
  1872.             theNumber = ( array2[index1]->set2[index2] );
  1873.             switch( theNumber )
  1874.             {
  1875.                 case 1: 
  1876.                     {
  1877.                         count_array2[1]++;
  1878.                         array2[index1]->odds2++;
  1879.                         (array2[index1]->reds2++);
  1880.                     } continue;
  1881.                     
  1882.                 case 2:
  1883.                     {
  1884.                         count_array2[2]++;
  1885.                         array2[index1]->evens2++;
  1886.                         (array2[index1]->reds2++);
  1887.                     } continue;
  1888.                     
  1889.                 case 3: 
  1890.                     {
  1891.                         count_array2[3]++;
  1892.                         array2[index1]->odds2++;
  1893.                         (array2[index1]->reds2++);
  1894.                     } continue;
  1895.                     
  1896.                 case 4: 
  1897.                     {
  1898.                         count_array2[4]++;
  1899.                         array2[index1]->evens2++;
  1900.                         (array2[index1]->reds2++);
  1901.                     } continue;
  1902.                     
  1903.                 case 5: 
  1904.                     {
  1905.                         count_array2[5]++;
  1906.                         array2[index1]->odds2++;
  1907.                         (array2[index1]->reds2++);
  1908.                     } continue;
  1909.                     
  1910.                 case 6: 
  1911.                     {
  1912.                         count_array2[6]++;
  1913.                         array2[index1]->evens2++;
  1914.                         (array2[index1]->reds2++);
  1915.                     } continue;
  1916.                     
  1917.                 case 7: 
  1918.                     {
  1919.                         count_array2[7]++;
  1920.                         array2[index1]->odds2++;
  1921.                         (array2[index1]->reds2++);
  1922.                     } continue;
  1923.                     
  1924.                 case 8: 
  1925.                     {
  1926.                         count_array2[8]++;
  1927.                         array2[index1]->evens2++;
  1928.                         (array2[index1]->reds2++);
  1929.                     } continue;
  1930.                     
  1931.                 case 9: 
  1932.                     {
  1933.                         count_array2[9]++;
  1934.                         array2[index1]->odds2++;
  1935.                         (array2[index1]->reds2++);
  1936.                     } continue;
  1937.                     
  1938.                 case 10: 
  1939.                     {
  1940.                         count_array2[10]++;
  1941.                         array2[index1]->evens2++;
  1942.                         (array2[index1]->reds2++);
  1943.                     } continue;
  1944.                     
  1945.                 case 11: 
  1946.                     {
  1947.                         count_array2[11]++;
  1948.                         array2[index1]->odds2++;
  1949.                         (array2[index1]->reds2++);
  1950.                     } continue;
  1951.                     
  1952.                 case 12: 
  1953.                     {
  1954.                         count_array2[12]++;
  1955.                         array2[index1]->evens2++;
  1956.                         (array2[index1]->reds2++);
  1957.                     } continue;
  1958.                     
  1959.                 case 13: 
  1960.                     {
  1961.                         count_array2[13]++;
  1962.                         array2[index1]->odds2++;
  1963.                         (array2[index1]->reds2++);
  1964.                     } continue;
  1965.                     
  1966.                 case 14: 
  1967.                     {
  1968.                         count_array2[14]++;
  1969.                         array2[index1]->evens2++;
  1970.                         (array2[index1]->reds2++);
  1971.                     } continue;
  1972.                     
  1973.                 case 15: 
  1974.                     {
  1975.                         count_array2[15]++;
  1976.                         array2[index1]->odds2++;
  1977.                         (array2[index1]->reds2++);
  1978.                     } continue;
  1979.                 
  1980.                 case 16:
  1981.                     {
  1982.                         count_array2[16]++;
  1983.                         array2[index1]->evens2++;
  1984.                         (array2[index1]->reds2++);
  1985.                     } continue;
  1986.                     
  1987.                 case 17:
  1988.                     {
  1989.                         count_array2[17]++;
  1990.                         array2[index1]->odds2++;
  1991.                         (array2[index1]->reds2++);
  1992.                     } continue;
  1993.                                                 // end of reds
  1994.                 case 18:
  1995.                     {
  1996.                         count_array2[18]++;
  1997.                         array2[index1]->evens2++;
  1998.                         (array2[index1]->whites2++);
  1999.                     } continue;
  2000.                     
  2001.                 case 19:
  2002.                     {
  2003.                         count_array2[19]++;
  2004.                         array2[index1]->odds2++;
  2005.                         (array2[index1]->whites2++);
  2006.                     } continue;
  2007.                     
  2008.                 case 20:
  2009.                     {
  2010.                         count_array2[20]++;
  2011.                         array2[index1]->evens2++;
  2012.                         (array2[index1]->whites2++);
  2013.                     } continue;
  2014.                     
  2015.                 case 21:
  2016.                     {
  2017.                         count_array2[21]++;
  2018.                         array2[index1]->odds2++;
  2019.                         (array2[index1]->whites2++);
  2020.                     } continue;
  2021.                     
  2022.                 case 22:
  2023.                     {
  2024.                         count_array2[22]++;
  2025.                         array2[index1]->evens2++;
  2026.                         (array2[index1]->whites2++);
  2027.                     } continue;
  2028.                     
  2029.                 case 23:
  2030.                     {
  2031.                         count_array2[23]++;
  2032.                         array2[index1]->odds2++;
  2033.                         (array2[index1]->whites2++);
  2034.                     } continue;
  2035.                     
  2036.                 case 24:
  2037.                     {
  2038.                         count_array2[24]++;
  2039.                         array2[index1]->evens2++;
  2040.                         (array2[index1]->whites2++);
  2041.                     } continue;
  2042.                     
  2043.                 case 25:
  2044.                     {
  2045.                         count_array2[25]++;
  2046.                         array2[index1]->odds2++;
  2047.                         (array2[index1]->whites2++);
  2048.                     } continue;
  2049.                     
  2050.                 case 26:
  2051.                     {
  2052.                         count_array2[26]++;
  2053.                         array2[index1]->evens2++;
  2054.                         (array2[index1]->whites2++);
  2055.                     } continue;
  2056.                     
  2057.                 case 27:
  2058.                     {
  2059.                         count_array2[27]++;
  2060.                         array2[index1]->odds2++;
  2061.                         (array2[index1]->whites2++);
  2062.                     } continue;
  2063.                     
  2064.                 case 28:
  2065.                     {
  2066.                         count_array2[28]++;
  2067.                         array2[index1]->evens2++;
  2068.                         (array2[index1]->whites2++);
  2069.                     } continue;
  2070.                     
  2071.                 case 29:
  2072.                     {
  2073.                         count_array2[29]++;
  2074.                         array2[index1]->odds2++;
  2075.                         (array2[index1]->whites2++);
  2076.                     } continue;
  2077.                     
  2078.                 case 30:
  2079.                     {
  2080.                         count_array2[30]++;
  2081.                         array2[index1]->evens2++;
  2082.                         (array2[index1]->whites2++);
  2083.                     } continue;
  2084.                     
  2085.                 case 31:
  2086.                     {
  2087.                         count_array2[31]++;
  2088.                         array2[index1]->odds2++;
  2089.                         (array2[index1]->whites2++);
  2090.                     } continue;
  2091.                     
  2092.                 case 32:
  2093.                     {
  2094.                         count_array2[32]++;
  2095.                         array2[index1]->evens2++;
  2096.                         (array2[index1]->whites2++);
  2097.                     } continue;
  2098.                     
  2099.                 case 33:
  2100.                     {
  2101.                         count_array2[33]++;
  2102.                         array2[index1]->odds2++;
  2103.                         (array2[index1]->whites2++);
  2104.                     } continue;
  2105.                     
  2106.                 case 34:
  2107.                     {
  2108.                         count_array2[34]++;
  2109.                         array2[index1]->evens2++;
  2110.                         (array2[index1]->whites2++);
  2111.                     } continue;
  2112.                                                     // end of whites
  2113.                 case 35:
  2114.                     {
  2115.                         count_array2[35]++;
  2116.                         array2[index1]->odds2++;
  2117.                         (array2[index1]->blues2++);
  2118.                     } continue;
  2119.                     
  2120.                 case 36:
  2121.                     {
  2122.                         count_array2[36]++;
  2123.                         array2[index1]->evens2++;
  2124.                         (array2[index1]->blues2++);
  2125.                     } continue;
  2126.                     
  2127.                 case 37:
  2128.                     {
  2129.                         count_array2[37]++;
  2130.                         array2[index1]->odds2++;
  2131.                         (array2[index1]->blues2++);
  2132.                     } continue;
  2133.                     
  2134.                 case 38:
  2135.                     {
  2136.                         count_array2[38]++;
  2137.                         array2[index1]->evens2++;
  2138.                         (array2[index1]->blues2++);
  2139.                     } continue;
  2140.                     
  2141.                 case 39:
  2142.                     {
  2143.                         count_array2[39]++;
  2144.                         array2[index1]->odds2++;
  2145.                         (array2[index1]->blues2++);
  2146.                     } continue;
  2147.                     
  2148.                 case 40:
  2149.                     {
  2150.                         count_array2[40]++;
  2151.                         array2[index1]->evens2++;
  2152.                         (array2[index1]->blues2++);
  2153.                     } continue;
  2154.                     
  2155.                 case 41:
  2156.                     {
  2157.                         count_array2[41]++;
  2158.                         array2[index1]->odds2++;
  2159.                         (array2[index1]->blues2++);
  2160.                     } continue;
  2161.                     
  2162.                 case 42:
  2163.                     {
  2164.                         count_array2[42]++;
  2165.                         array2[index1]->evens2++;
  2166.                         (array2[index1]->blues2++);
  2167.                     } continue;
  2168.                     
  2169.                 case 43:
  2170.                     {
  2171.                         count_array2[43]++;
  2172.                         array2[index1]->odds2++;
  2173.                         (array2[index1]->blues2++);
  2174.                     } continue;
  2175.                     
  2176.                 case 44:
  2177.                     {
  2178.                         count_array2[44]++;
  2179.                         array2[index1]->evens2++;
  2180.                         (array2[index1]->blues2++);
  2181.                     } continue;
  2182.                     
  2183.                 case 45:
  2184.                     {
  2185.                         count_array2[45]++;
  2186.                         array2[index1]->odds2++;
  2187.                         (array2[index1]->blues2++);
  2188.                     } continue;
  2189.                     
  2190.                 case 46:
  2191.                     {
  2192.                         count_array2[46]++;
  2193.                         array2[index1]->evens2++;
  2194.                         (array2[index1]->blues2++);
  2195.                     } continue;
  2196.                     
  2197.                 case 47:
  2198.                     {
  2199.                         count_array2[47]++;
  2200.                         array2[index1]->odds2++;
  2201.                         (array2[index1]->blues2++);
  2202.                     } continue;
  2203.                     
  2204.                 case 48: 
  2205.                     {
  2206.                         count_array2[48]++;
  2207.                         array2[index1]->evens2++;
  2208.                         (array2[index1]->blues2++);
  2209.                     } continue;
  2210.                 
  2211.                 case 49:
  2212.                     {
  2213.                         count_array2[49]++;
  2214.                         array2[index1]->odds2++;
  2215.                         (array2[index1]->blues2++);
  2216.                     } continue;
  2217.                     
  2218.                 case 50:
  2219.                     {
  2220.                         count_array2[50]++;
  2221.                         array2[index1]->evens2++;
  2222.                         (array2[index1]->blues2++);
  2223.                     } continue;
  2224.                     
  2225.                 case 51:
  2226.                     {
  2227.                         count_array2[51]++;
  2228.                         array2[index1]->odds2++;
  2229.                         (array2[index1]->blues2++);
  2230.                     } continue;
  2231.                     
  2232.                 default:
  2233.                     {
  2234.                         break;
  2235.                     }
  2236.             }
  2237.         }
  2238.     }
  2239.     
  2240.     
  2241.     
  2242.         int index62;
  2243.         int temp2;
  2244.         for( index62 = 0; index62 < 10; index62++ )
  2245.         {
  2246.             temp2 = 0;
  2247.             temp2 += (array2[index62]->set2[1] - array2[index62]->set2[0]);
  2248.             temp2 += (array2[index62]->set2[2] - array2[index62]->set2[1]);
  2249.             temp2 += (array2[index62]->set2[3] - array2[index62]->set2[2]);
  2250.             temp2 += (array2[index62]->set2[4] - array2[index62]->set2[3]);
  2251.             temp2 += (array2[index62]->set2[5] - array2[index62]->set2[4]);
  2252.             
  2253.             array2[index62]->sum_of_diffs2 = temp2;
  2254.         }
  2255.         
  2256.         int index72;
  2257.         for( index72 = 0; index72 < 10; index72++ )
  2258.         {
  2259.             float sum2 = 0;
  2260.             int summer2 = 0;
  2261.             
  2262.             for( summer2 = 0; summer2 < 6; summer2++ )
  2263.             {
  2264.                 sum2 += array2[index72]->set2[summer2];
  2265.             }
  2266.             array2[index72]->average2 = (( sum2 / 6 ) + .5);
  2267.         }
  2268.         
  2269.         
  2270.     cout << endl << endl << endl << endl << endl << endl;
  2271.     cout << "Possible Alternates:" << endl << endl;
  2272.     
  2273.     int numcnt = 0;    
  2274.     // print out the alternates
  2275.     
  2276.     numcnt = 5;
  2277.     for( int prt1 = 0; prt1 < 10; prt1++ )
  2278.     {
  2279.         if( array2[prt1]->use == 0 )
  2280.         {
  2281.             numcnt++;
  2282.             cout << "Set #" << numcnt << "  **  ";
  2283.             for( int prt2 = 0; prt2 < 6; prt2++ )
  2284.             {
  2285.                 cout << (array2[prt1]->set2[prt2]) << ' ';
  2286.             }
  2287.             cout << "  **" << endl;
  2288.             
  2289.         cout << "Odds: " << array2[prt1]->odds2 << ' ' << ' ';
  2290.         cout << "Evens: " << array2[prt1]->evens2 << ' ' << ' ';
  2291.         cout << "Whites: " << array2[prt1]->whites2 << ' ' << ' ';
  2292.         cout << "Blues: " << array2[prt1]->blues2 << ' ' << ' ';
  2293.         cout << "Reds: " << array2[prt1]->reds2 << endl;
  2294.         cout << "Average: " << array2[prt1]->average2 << ' ' << ' ';
  2295.         cout << "Sum Of Differences: " << array2[prt1]->sum_of_diffs2 << ' ' << ' ';
  2296.         cout << endl << "                 Distribution Matches:  ";
  2297.             for( int dis1 = 0; dis1 < 6; dis1++ )
  2298.             {
  2299.                 cout << count_array[(array2[prt1]->set2[dis1])] << ' ';
  2300.             }
  2301.         cout << endl << endl << endl;
  2302.         }
  2303.     }
  2304.         
  2305.     cout << "           ===***********************===" << endl;
  2306.     cout << endl << endl << endl << endl;
  2307.     
  2308.     
  2309.     cout << "Here are 5 number sets to use in the next draw: " << endl << endl;                    
  2310.         
  2311.     numcnt = 0;
  2312.     for( int prt1 = 0; prt1 < 10; prt1++ )
  2313.     {
  2314.         if( array2[prt1]->use == 1 )
  2315.         {
  2316.             numcnt++;
  2317.             cout << "Set #" << numcnt << "  **  ";
  2318.             for( int prt2 = 0; prt2 < 6; prt2++ )
  2319.             {
  2320.                 cout << (array2[prt1]->set2[prt2]) << ' ';
  2321.             }
  2322.             cout << "  **" << endl;
  2323.             
  2324.         cout << "Odds: " << array2[prt1]->odds2 << ' ' << ' ';
  2325.         cout << "Evens: " << array2[prt1]->evens2 << ' ' << ' ';
  2326.         cout << "Whites: " << array2[prt1]->whites2 << ' ' << ' ';
  2327.         cout << "Blues: " << array2[prt1]->blues2 << ' ' << ' ';
  2328.         cout << "Reds: " << array2[prt1]->reds2 << endl;
  2329.         cout << "Average: " << array2[prt1]->average2 << ' ' << ' ';
  2330.         cout << "Sum Of Differences: " << array2[prt1]->sum_of_diffs2 << ' ' << ' ';
  2331.         cout << endl << "                 Distribution Matches:  ";
  2332.             for( int dis1 = 0; dis1 < 6; dis1++ )
  2333.             {
  2334.                 cout << count_array[(array2[prt1]->set2[dis1])] << ' ';
  2335.             }
  2336.         cout << endl << endl;
  2337.         }
  2338.     }
  2339.     
  2340.     cout << "Now you can print or save the results!" << endl;
  2341.     cout << "I make no claim that you will win any prize!" << endl;
  2342.     cout << "This program is for entertainment purposes only!" << endl;
  2343. exit( 0 );
  2344. }
  2345.  
  2346.     
  2347.